﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt;

    public class wf_type_Map : ClassMapping<wf_type>
    {
        public wf_type_Map()
        {
            Id(x => x.wf_type_id, map =>
            {
                map.Length(40);
                map.Column(wf_type.Columns.wf_type_id);
            });
            Property(x => x.is_valid, map => map.Column(wf_type.Columns.is_valid));
            Property(x => x.create_date, map => map.Column(wf_type.Columns.create_date));

            Property(x => x.wf_type_code, map =>
            {
                map.Length(20);
                map.Column(wf_type.Columns.wf_type_code);
            });
            Property(x => x.wf_type_name, map =>
            {
                map.Length(50);
                map.Column(wf_type.Columns.wf_type_name);
            });

            Bag(x => x.wf_nodes, map =>
            {
                map.Key(km => km.Column(DB_Model.ywxt.wf_node.Columns.n_type_id));
            }, act => act.OneToMany());

            Table(wf_type.TableName);

            SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
